package com.loong.nnm.impl;


import com.loong.nnm.entity.alarm.TcaParameter;
import com.loong.nnm.entity.performance.Performance;
import com.loong.nnm.services.PerformanceServices;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("PerformanceServices")
public class PerformanceImpl implements PerformanceServices {

//    @Resource
    private NetconfToolImpl netconfTool = new NetconfToolImpl();

    @Override
    public String getPerformances(String node) {
        return netconfTool.get(node, "<get>\n" +
                "<filter type=\"subtree\">\n" +

                "<performances xmlns=\"urn:ccsa:yang:acc-performance\">\n" +

                "</performances>\n" +

                "</filter>\n" +
                "</get>");
    }

    @Override
    public String getCurrentPerformances(String node, Performance performance) {
        return netconfTool.get(node, "<get>\n" +
                "<filter type=\"subtree\">\n" +

                "<performances xmlns=\"urn:ccsa:yang:acc-performance\">\n" +

                "</performances>\n" +

                "</filter>\n" +
                "</get>");
    }

    @Override
    public String getHistoryPerformances(String node, Performance performance) {
        return netconfTool.get(node, "" +
                "<get-history-performance-monitoring-data xmlns=\"urn:ccsa:yang:acc-performance\">\n" +
                "    <start-time>8068-57-55T72:15:14.6+22:54</start-time>\n" +
                "    <end-time>0402-24-66T74:01:82.7-61:44</end-time>\n" +
                "    <object-name>x</object-name>\n" +
                "    <granularity>15min</granularity>\n" +
                "    <pm-parameter-name>x</pm-parameter-name>\n" +
                "</get-history-performance-monitoring-data>");
    }
}
